using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Main
{
    /// <summary>
    /// 物品类型
    /// </summary>
    public enum ItemType
    {
        Seed, Commodity, Furniture,
        HoeTool, ChopTool, BreakTool, ReapTool, WaterTool, CollectTool,
        ReapableScenery
    }

    /// <summary>
    /// 背包格式
    /// </summary>
    public enum SlotType
    {
        Bag,
        Box,
        Shop,
    }

    /// <summary>
    /// 主角背包
    /// </summary>
    public enum InventoryLocation
    {
        Player,
        Box,
    }

    /// <summary>
    /// 
    /// </summary>
    public enum PartType
    {
        None, Carry, Hoe, Water, Break, Collect, Chop, Reap
    }


    public enum PartName
    {
        Body, Hair, Arm, Tool
    }


    public enum Season
    {
        Spring, Summer, Autumn, Winter
    }

    /// <summary>
    /// 格子类型
    /// </summary>
    public enum GridType
    {
        Digable, DropItem, PlaceFurniture, NPCObstacle
    }

    public enum ParticleEffectType
    {
        None, LeavesFall01, LeavesFall02, Rock, ReapableScenery
    }

    public enum GameState
    {
        GamePlay,
        Pause,
    }

    public enum LightShift
    {
        Morning,
        Night,
    }

    public enum SoundName
    {
        None, FootStepSoft, FootStepHard,
        Axe, Pickaxe, Hoe, Reap, Water, Basket, Chop,
        Pickup, Plant, TreeFalling, Rustle,
        AmbientCountryside1, AmbientCountryside2,
        MusicClam1, MusicClam2, MusicClam3, MusicClam4, MusicClam5, MusicClam6,
        AmbientIndoor1,
    }

    public static class EnumsExtension
    {
        public static string ToCN(this ItemType itemType)
        {
            return itemType switch
            {
                ItemType.Seed => "种子",
                ItemType.Commodity => "商品",
                ItemType.Furniture => "家具",
                ItemType.HoeTool => "工具",
                ItemType.ChopTool => "工具",
                ItemType.BreakTool => "工具",
                ItemType.ReapTool => "工具",
                ItemType.WaterTool => "工具",
                ItemType.CollectTool => "工具",
                ItemType.ReapableScenery => "杂草",
                _ => "未知",
            };
        }

        public static PartType ToPartType(this ItemType itemType)
        {
            return itemType switch
            {
                ItemType.Seed => PartType.Carry,
                ItemType.Commodity => PartType.Carry,
                ItemType.HoeTool => PartType.Hoe,
                ItemType.WaterTool => PartType.Water,
                ItemType.CollectTool => PartType.Collect,
                ItemType.BreakTool => PartType.Break,
                ItemType.ChopTool => PartType.Chop,
                ItemType.ReapTool => PartType.Reap,
                ItemType.Furniture => PartType.Carry,
                _ => PartType.None
            };
        }

        public static string ToCN(this Season season)
        {
            return season switch
            {
                Season.Spring => "春天",
                Season.Summer => "夏天",
                Season.Autumn => "秋天",
                Season.Winter => "冬天",
                _ => "未知"
            };
        }


        public static bool IsTool(this ItemType itemType)
        {
            return itemType != ItemType.Seed && itemType != ItemType.Commodity &&
            itemType != ItemType.Furniture && itemType != ItemType.ReapableScenery;
        }
    }
}

